package com.mark.toolImpl;

import java.sql.Connection;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

import com.jdbcUtil.JDBCUtil;
import com.mark.database.Mark1;
import com.mark.database.Mark2;
//删除收藏
public class DelMarkImpl {
  //删除类型工作1收藏
	public boolean delMark1(Mark1 m1){
		Connection conn=null;
		PreparedStatement ps=null;
		ResultSet rs=null;
		try{
			conn=JDBCUtil.getConnection();
			String sql="delete from mark1 where uid="+m1.getUid()+" and job1id="+m1.getJobId()+";";
			ps=conn.prepareStatement(sql);
			int result=ps.executeUpdate();
			if(result>0){
				return true;
			}
		}catch(Exception e){
			System.out.println(e);
		}finally{
			JDBCUtil.free(conn, ps, rs);
		}
		return false;
	}
	//删除类型工作2收藏
	public boolean delMark2(Mark2 m2){
		Connection conn=null;
		PreparedStatement ps=null;
		ResultSet rs=null;
		try{
			conn=JDBCUtil.getConnection();
			String sql="delete from mark2 where uid="+m2.getUid()+" and job2id="+m2.getJobId()+";";
			ps=conn.prepareStatement(sql);
			int result=ps.executeUpdate();
			if(result>0){
				return true;
			}
		}catch(Exception e){
			System.out.println(e);
		}finally{
			JDBCUtil.free(conn, ps, rs);
		}
		return false;
	}
}
